package com.zyx.mapstruct.util;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author Yaxi.Zhang
 * @since 2022/10/11 14:44
 */
public class DateTransform {

    public static LocalDateTime strToDate(String str){
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyy-MM-dd HH:mm:ss");
        LocalDateTime ldt = LocalDateTime.parse("2022-10-11 14:44:05",df);
        System.out.println("String类型的时间转成LocalDateTime："+ldt);
        return ldt;
    }

}
